package com.hotel.controller;

import com.hotel.pojo.FoodType;
import com.hotel.pojo.Table;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * Created by LinYaTing on 2018/11/30 22:13
 */
@WebServlet(name = "IndexServlet",urlPatterns = "/index")
public class IndexServlet extends BaseServlet {

    private Object uri;

    //前台首页列表展示
    public Object listTable(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //调用业务逻辑
        List<Table> noUseTable = tableService.findNoUseTable();
        //保存
        request.setAttribute("noUseTable", noUseTable);
        uri = request.getRequestDispatcher("/app/index.jsp");
        return uri;
    }
}
